package logic

import (
	"context"
	"onerk4/zk3/common/proto/user"
	"onerk4/zk3/service/server"
)

type UserServer struct {
	user.UnimplementedUserServer
}

func (u UserServer) Register(ctx context.Context, req *user.RegisterOrLoginRequest) (*user.RegisterOrLoginResponse, error) {
	register, err := server.Register(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (u UserServer) Login(ctx context.Context, req *user.RegisterOrLoginRequest) (*user.RegisterOrLoginResponse, error) {
	register, err := server.Login(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (u UserServer) AddStudyPlanShow(ctx context.Context, req *user.AddStudyPlanShowRequest) (*user.AddStudyPlanShowResponse, error) {
	register, err := server.AddStudyPlanShow(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (u UserServer) DelStudyPlanShow(ctx context.Context, req *user.DelStudyPlanShowRequest) (*user.DelStudyPlanShowResponse, error) {
	register, err := server.DelStudyPlanShow(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (u UserServer) CreateOrder(ctx context.Context, req *user.CreateOrderRequest) (*user.CreateOrderResponse, error) {
	register, err := server.CreateOrder(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}
